home *** CD-ROM | disk | FTP | other *** search
- ; PSPad clip definition file for Java
- ; Created by PSPad 14.7.2002
- ; Author: Jan Fiala pspad@wo.cz
- ;
- [prog | Java program - base]
- public class |MyProg {
- /** code description */
- public static void main(String[] args) {
- /* multiline comments */
- // single line comments
- System.out.println("Hello, world");
- }
- }
- ;
- [servlet | Java Servlet - base]
- import java.io.*;
- import javax.servlet.*;
- import javax.servlet.http.*;
-
- public class |MyServlet extends HttpServlet {
- PrintWriter out;
-
- public void doGet(HttpServletRequest req, HttpServletResponse res) {
- try {
- res.setContentType("text/html");
- out = res.getWriter();
- String html = "<html>Hello, world</html>";
- out.println(html);
- }
- catch (Exception e) { e.printStackTrace(); }
- }
-
- public void doPost(HttpServletRequest req, HttpServletResponse res) {
- try {
- res.setContentType("text/html");
- out = res.getWriter();
- String html = "<html>Hello, world</html>";
- out.println(html);
- }
- catch (Exception e) { e.printStackTrace(); }
- }
- }
- ;
- [for | for cycle]
- for (int i=0; i<|; i++) {}
- ;
- [try | try-catch block]
- try {
- |
- }
- catch (Exception e) {
- System.out.println("Unexpected exception");
- e.printStackTrace();
- }
- finally {}
- ;
- [while | while cycle]
- int i=0;
- while (i < |) {
-
- i++;
- }